package com.tuzhi.atuh.controller;

import com.tuzhi.atuh.component.AuthUser;
import com.tuzhi.auth.vo.LoginUser;
import com.tuzhi.base.web.controller.SimpleBaseController;
import org.springframework.beans.factory.annotation.Autowired;

public abstract class AuthBaseCotroller<T, Pk, E> extends SimpleBaseController<T, Pk, E> {

    @Autowired
    private AuthUser authUser;


    /**
     * 获取当前token的用户信息
     *
     * @return
     */
    protected LoginUser getCurUser() {
        return authUser.getCurLoginUser4Token(false);
    }

    protected LoginUser getCurUserNotNull() {
        return authUser.getCurLoginUser4Token(true);
    }

}
